# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: SleepyDog

pkgname=glew
pkgver=2.2.0
pkgrel=2
pkgdesc="The OpenGL Extension Wrangler Library"
arch=('x86_64')
url="https://github.com/nigels-com/glew"
license=('BSD' 'MIT' 'GPL')
depends=('libxmu' 'libxi' 'glu')
provides=('libGLEW.so')
# https://sourceforge.net/projects/glew/files/glew/
source=(https://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tgz
        glew-install.patch)
sha1sums=('22d6e9b9e691080eb6313407dbf51cfebc3345ea'
          'e1bfa1e6ae3c7a553920978111092ea9d3a33c95')

prepare() {
  cd ${pkgname}-${pkgver}
  patch -Np1 -i ../glew-install.patch
}

build() {
  cd ${pkgname}-${pkgver}
  make \
   STRIP= \
   LIBDIR=/usr/lib
}

package() {
  cd ${pkgname}-${pkgver}
  make install.all DESTDIR="$pkgdir" \
    LIBDIR=/usr/lib
  install -D -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
